/*Find the sum of array elements*/



public class ArrayOps
{
   /*
      This method adds up the integer values in an array,
      with the integer sum returned at the end of the method.
      @param values, an array of integers, may be positive or negative
      @ return, the sum of the integers
   */
   public static int sumArray(int values[])
   {

      // your work here
      int x=0;
      int n=values.length;
      for(int i=0;i<n;i++)
         x=x+values[i];
      // initialize sum

      // add all elements to sum
      return x;
      // return sum
   }
}